<include file="Public:header" />
<div class="container">
	<!-- Docs nav ================================================== -->
	<div class="page-header"><h4>{:L('OPERATE_LOG')}</h4></div>
	<include file="Public:alert" />
	<p class="view"><b>{:L('VIEW_NAV')}</b>
	<img src=" __PUBLIC__/img/by_owner.png"/> <a href="{:U('action_log/index')}" <if condition="$Think.get.by eq null">class="active"</if>>{:L('ALL')}</a> |
	<a href="{:U('action_log/index','by=me')}" <if condition="$Think.get.by eq 'me'">class="active"</if>>{:L('MY_LOG')}</a> |
	<img src="__PUBLIC__/img/by_time.png"/> <a href="{:U('action_log/index','by=today')}" <if condition="$Think.get.by eq 'today'">class="active"</if>>{:L('CREATE_TODAY')}</a> | 
	<a href="{:U('action_log/index','by=week')}" <if condition="$Think.get.by eq 'week'">class="active"</if>>{:L('CREATE_THIS_WEEK')}</a> | 
	<a href="{:U('action_log/index','by=month')}" <if condition="$Think.get.by eq 'month'">class="active"</if>>{:L('CREATE_THIS_MONTH')}</a>  &nbsp; 
	<a href="{:U('action_log/index','by=add')}" <if condition="$Think.get.by eq 'add'">class="active"</if>>{:L('RECENTLY_CREATED')}</a>
	</p>
	<div class="row">
		<div class="span2 knowledgecate">
			<ul class="nav nav-list">
				<li class="active">
					<a href="javascript:void(0);">{:L('VIEW_BY_LOG_CATEGORY')}</a>
				</li>
				<li><a href="{:U('action_log/index','by='.$_GET['by'])}" <if condition="$_GET['module'] eq null">class="active"</if>><i class="icon-white icon-chevron-right"></i>{:L('ALL')}</a></li>
				<li><a href="{:U('action_log/index','module=business&by='.$_GET['by'].'&act='.$_GET['act'])}" <if condition="$_GET['module'] eq 'business'">class="active"</if>><i class="icon-chevron-right"></i>{:L('BUSINESS')}</a></li>
				<li><a href="{:U('action_log/index','module=product&by='.$_GET['by'].'&act='.$_GET['act'])}" <if condition="$_GET['module'] eq 'product'">class="active"</if>><i class="icon-chevron-right"></i>{:L('PRODUCT')}</a></li>
				<li><a href="{:U('action_log/index','module=customer&by='.$_GET['by'].'&act='.$_GET['act'])}" <if condition="$_GET['module'] eq 'customer'">class="active"</if>><i class="icon-chevron-right"></i>{:L('CUSTOMER')}</a></li>
				<li><a href="{:U('action_log/index','module=leads&by='.$_GET['by'].'&act='.$_GET['act'])}" <if condition="$_GET['module'] eq 'leads'">class="active"</if>><i class="icon-chevron-right"></i>{:L('LEADS')}</a></li>
				<li><a href="{:U('action_log/index','module=finance&by='.$_GET['by'].'&act='.$_GET['act'])}" <if condition="$_GET['module'] eq 'finance'">class="active"</if>><i class="icon-chevron-right"></i>{:L('FINANCE')}</a></li>
			</ul>
		</div>
		<div class="span10">
			<p style="font-size:14px;">
				<b>{:L('FILTER')}</b>
				<a <if condition="$_GET['act'] == null">class="active"</if> href="{:U('ActionLog/index','module='.$_GET['module'].'&by='.$_GET['by'].'&type=1')}">{:L('ALL_THE_OPERATION')}</a> &nbsp; | &nbsp; 
				<a <if condition="$_GET['act'] == 'add'">class="active"</if> href="{:U('ActionLog/index','module='.$_GET['module'].'&by='.$_GET['by'].'&act=add')}">{:L('ADD')}</a> &nbsp; | &nbsp; 
				<a <if condition="$_GET['act'] == 'edit'">class="active"</if> href="{:U('ActionLog/index','module='.$_GET['module'].'&by='.$_GET['by'].'&act=edit')}">{:L('EDIT')}</a> &nbsp; | &nbsp; 
				<a <if condition="$_GET['act'] == 'delete'">class="active"</if> href="{:U('ActionLog/index','module='.$_GET['module'].'&by='.$_GET['by'].'&act=delete')}">{:L('DELETE')}</a> &nbsp; | &nbsp; 
				<a <if condition="$_GET['act'] == 'completedelete'">class="active"</if> href="{:U('ActionLog/index','module='.$_GET['module'].'&by='.$_GET['by'].'&act=completedelete')}">{:L('RECYCLE_BIN')}</a> 
			</p>
			<ul class="nav pull-left">		
				<li class="pull-left"><a id="delete" class="btn" ><i class="icon-remove"></i>&nbsp;{:L('DELETE')}</a> </li>
				<li class="pull-left">
					<form class="form-inline" id="searchForm" onsubmit="return checkSearchForm();" action="index.php" method="get">
						<ul class="nav pull-left">
							<li class="pull-left">
								&nbsp;
								<select id="field" style="width:auto" onchange="changeCondition()" name="field">
									<option class="word" value="content">{:L('OPERATOR')}</option>
									<option class="date" value="create_time">{:L('OPERATING_TIME')}</option>
								</select>&nbsp;&nbsp;
							</li>
							<li id="conditionContent" class="pull-left">
							<select id="condition" style="width:auto" name="condition" onchange="changeSearch()">
								<option value="contains">{:L('CONTAINS')}</option>
								<option value="not_contain">{:L('NOT_CONTAIN')}</option>
								<option value="is">{:L('IS')}</option>
								<option value="isnot">{:L('ISNOT')}</option>						
								<option value="start_with">{:L('START_WITH')}</option>
								<option value="end_with">{:L('END_WITH')}</option>
								<option value="is_empty">{:L('IS_EMPTY')}</option>
								<option value="is_not_empty">{:L('IS_NOT_EMPTY')}</option>
								</select>&nbsp;&nbsp;
							</li>
							<li id="searchContent" class="pull-left"><input id="search" type="text" class="input-medium search-query" name="search"/>&nbsp;&nbsp;</li>
							<li class="pull-left"><input type="hidden" name="m" value="action_log"/>
							<if condition="$Think.get.by neq null"><input type="hidden" name="by" value="{$Think.get.by}"/></if>
							<if condition="$Think.get.act neq null"><input type="hidden" name="act" value="{$Think.get.act}"/></if>
							<if condition="$Think.get.module neq null"><input type="hidden" name="module" value="{$Think.get.module}"/></if>
							<button type="submit" class="btn"> <img src="__PUBLIC__/img/search.png"/>  {:L('SEARCH')}</button></li>
						</ul>
					</form>
				</li>
			</ul>
		</div>
		<div class="span10">
			<form id="form1" method="post">
			<table class="table table-hover table-striped table_thead_fixed">
				<if condition="$list eq null">
					<tr><td>{:L('EMPTY_TPL_DATA')}</td></tr>
				<else/>
					<thead>
						<tr>
							<th><input id="check_all" class="check_all" type="checkbox" /></th>
							<th>{:L('OPERATOR')}</th>
							<th>{:L('MODULE')}</th>
							<th>{:L('CONTENT')}</th>
							<th>
								<if condition="$_GET['asc_order'] == 'create_time'">
									<a href="{:U('actionLog/index','desc_order=create_time&'.$parameter)}">
										{:L('TIME')}&nbsp;<img src="__PUBLIC__/img/arrow_up.png">
									</a>
								<elseif condition="$_GET['desc_order'] == 'create_time'"/>
									<a href="{:U('actionLog/index','asc_order=create_time&'.$parameter)}">
										{:L('TIME')}&nbsp;<img src="__PUBLIC__/img/arrow_down.png">
									</a>
								<else/>
									<a href="{:U('actionLog/index','desc_order=create_time&'.$parameter)}">{:L('TIME')}</a>
								</if>
							</th>
						</tr>
					</thead>
					<tbody>
						<volist name="list" id="vo">
						<tr>
							<td><input class="check_list" type="checkbox" name="log_id[]" value="{$vo.log_id}"/></td>
							<td><notempty name="vo.creator.user_name"><a class="role_info" rel="{$vo.creator.role_id}" href="javascript:void(0)">{$vo.creator.user_name}</a></notempty></td>
							<td>{:L($vo['module_name'])}</a></td>
							<td>{$vo.content}</a></td>
							<td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
						</tr>
						</volist>
					</tbody>
                    <tfoot>
                        <tr>
                            <td colspan="5">{$page}</td>
                        </tr>
                    </tfoot>
				</if>
			</table>
			
			</form>
		</div>
	</div>
</div>
<div class="hide" id="dialog-role-info" title="{:L('DIALOG_USER_INFO')}">loading...</div>
<script type="text/javascript">
$("#dialog-role-info").dialog({
    autoOpen: false,
    modal: true,
	width: 600,
	maxHeight: 400,
	position: ["center",100]
});
$(function(){
	<if condition="$Think.get.field neq null">
		$("#field option[value='{$Think.get.field}']").prop("selected", true);changeCondition();
		$("#condition option[value='{$Think.get.condition}']").prop("selected", true);changeSearch();
		$("#search").prop('value', '{$Think.get.search}');
	</if>
	$('#delete').click(function(){
		if(confirm('{:L('CONFIRM_DELETE')}')){
			$("#form1").attr('action', '{:U("Action_log/delete")}');
			$("#form1").submit();
		}
	});
	$("#check_all").click(function(){
		$("input[class='check_list']").prop('checked', $(this).prop("checked"));
	});
	$(".role_info").click(function(){
		$role_id = $(this).attr('rel');
		$('#dialog-role-info').dialog('open');
		$('#dialog-role-info').load('{:U("user/dialoginfo","id=")}'+$role_id);
	});
})
</script>
<include file="Public:footer" />
